package appReate.tab;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class TestFragmentAdapter extends FragmentPagerAdapter {
	private int mCount;

	protected static String[] mContent = new String[6];
	protected Context mContext;

	public TestFragmentAdapter(FragmentManager fm, Context context) {
		super(fm);
		mContent[0] = "Generale";
		mContent[1] = "Giro 2012";
		mContent[2] = "World Tour";
		mContent[3] = "Analisi Corse";
		mContent[4] = "Top/Flop";
		mContent[5] = "CicloMercato";
		mContext = context;

		mCount = mContent.length;
	}

	@Override
	public Fragment getItem(int position) {
		return TestFragment.newInstance(position, mContext);
	}

	@Override
	public int getCount() {
		return mCount;
	}

	public void setCount(int count) {
		if (count > 0 && count <= 10) {
			mCount = count;
			notifyDataSetChanged();
		}
	}
}